﻿<UserControl x:Class="XSemmel.Editor.FragmentView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:AvalonEdit="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit" 
        xmlns:GridView="clr-namespace:WmHelp.XmlGrid;assembly=XmlGridControl" 
        mc:Ignorable="d" 
        d:DesignHeight="80" d:DesignWidth="400" >
    <DockPanel>
        <TabControl TabStripPlacement="Left">
            <TabControl.Resources>
                <Style TargetType="{x:Type TabItem}">
                    <Setter Property="Padding" Value="4" />
                    <Setter Property="HeaderTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <ContentPresenter Content="{TemplateBinding Content}">
                                    <ContentPresenter.LayoutTransform>
                                        <RotateTransform Angle="-90" />
                                    </ContentPresenter.LayoutTransform>
                                </ContentPresenter>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </TabControl.Resources>
            <TabItem Header="Text">
                <AvalonEdit:TextEditor x:Name="_edtFragment" x:FieldModifier="private"
                    IsReadOnly="True" FontFamily="Consolas"
                    FontSize="10pt" SyntaxHighlighting="XML" ShowLineNumbers="False"
                    Background="WhiteSmoke"
                >
                    <AvalonEdit:TextEditor.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="Open in new Xsemmel" Click="mnuOpenInNewXSemmel_Click"/>
                        </ContextMenu>
                    </AvalonEdit:TextEditor.ContextMenu>
                </AvalonEdit:TextEditor>
            </TabItem>
            <TabItem Header="Grid">
                <WindowsFormsHost x:Name="gridHost">
                    <GridView:XmlGridView x:Name="_gridFragment" x:FieldModifier="private"
                                          AutoHeightCells="True" BackColor="WhiteSmoke"/>
                </WindowsFormsHost>
            </TabItem>
        </TabControl>
        
    </DockPanel>
</UserControl>
